home *** CD-ROM | disk | FTP | other *** search
- /************************************/
- /* GfxCON */
- /* by Matthias Finger */
- /* Scale a given image by any size. */
- /************************************/
- test=0 /* Just to test the script from a shell (test=1) for use with autoindex: test=0 */
-
- /* Only make changes here in the next 4 lines */
-
- GFXCON="dh1:utils/GfxCon_68020 " /* Path for GfxCON (SPACE reqiered) */
- FORM="GIF" /* Format for destination pictiure */
- /* FORM="JPEG" */
- QUALITY=85 /* Quality for jpeg destination */
- VERBOSE=0 /* Verbose: 1=OFF, 0=ON */
- OTHER="" /* Other options for GfxCON */
-
- /* ------- You should know what you do, if you change anything below -------- */
- Options results
- signal on error /* Setup a place for errors to go */
- if arg()==0 then exit
-
- PARSE ARG source dest sizex sizey .
-
- IF(test==1) THEN DO
- say GFXCON
- say FORM
- say QUALITY
- say OTHER
- say VERBOSE
- say source
- say dest
- say sizex
- say sizey
- END
- ELSE DO
- /* strip off the " character at the begin and end of the strings */
- source= LEFT(source, LENGTH(source)-1)
- source=RIGHT(source, LENGTH(source)-1)
- dest = left(dest,length(dest)-1)
- dest = right(dest,length(dest)-1)
- END
-
- IF ~EXISTS(dest) THEN DO
- call pragma("STACK",22000)
- comm = GFXCON||source
- IF(VERBOSE==1) THEN
- comm = comm||' >NIL:'
- comm = comm||' TO '||dest||' FORMAT 'FORM
- IF (UPPER(FORM)=="JPEG") THEN DO
- comm = comm||' QUALITY 'QUALITY||' '
- END
- comm = comm||' '||OTHER||' BOXFIT '||sizex||' '||sizey
- IF (test==1) THEN
- say "comm3: "comm
- ADDRESS COMMAND comm
- END
-
- EXIT
-
- /*******************************************************************/
- /* This is where control goes when an error code is returned by IE */
- /* It puts up a message saying what happened and on which line */
- /*******************************************************************/
- error:
- if RC=5 then do /* Did the user just cancel us? */
- LAST_ERROR
- 'REQUEST "'||RESULT||'"'
- exit
- end
- else do
- LAST_ERROR
- 'REQUEST "Error detected!!!'||D2C(10)||'GfxCON error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
- exit
- end
-
-